<template>
  <tbody>
    <tr v-for="(item,index) in goodList" :key="index">
      <td><input type="checkbox" 
      v-model="item.checked"
      /></td>
      <td>{{item.name}}</td>
      <td>{{item.price}}</td>
      <td><button @click="downFn(item.name)">-</button> 
      <span>{{item.num}}</span> 
      <button @click="upFn(item.name)">+</button></td>
      <td>{{ item.price *  item.num}}</td>
      <td><button @click="delFn(item.name)">删除</button></td>
    </tr>
  </tbody>
</template>


<script>
export default {
  data(){
    return {
      sum:0,
    }
  },
props:{
  goodList:Array,
},
methods:{
downFn(name){
  this.$emit('downFn',name)
},
upFn(name){
  this.$emit('upFn',name)
},
delFn(name){
  this.$emit('delFn',name)
}
},
computed:{

}
}
</script>
